Skip to content

GH Issue 1920: Fire one change from the date-time field with its full value - #329

Merged
labkey-tchad merged 2 commits into
release26.11-SNAPSHOTfrom
26.11_fb_datetime_field_change_1920
Nov 17, 2026
Merged

labkey-tchad merged 2 commits into
release26.11-SNAPSHOTfrom
26.11_fb_datetime_field_change_1920

Conversation

@labkey-tchad

@labkey-tchad labkey-tchad commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Rationale

(GH Issue 1920)
The field is made of two boxes, one for the date and one for the time. Today, when either box changes, the box's own change event is passed up as if the date-time field had fired it. That has three effects:

  • Code listening for changes is handed the inner box, not the date-time field.
  • The value it receives is only that box's part: a date at midnight, or a time on a placeholder date.
  • Setting the field's value in code fires two changes, and the first has the new date with the old time.

With the PR, each edit or programmatic set fires one change from the date-time field itself, with the full date-time and the previous value.

Related Pull Requests

Changes

  • Editing the date or time fires one change from the date-time field, with the combined value and the previous value
  • Setting the value in code fires one change instead of one per box
  • The field's starting value is the parsed date, so the first change and a reset compare against the right value

@bbimber

bbimber commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

@labkey-tchad: this is an interesting patch...can you say more about how this is manifesting?

  • I can see how in theory bubbling the change event might raise odd problems, or report change events that are misleading. At least by eye, the change seems OK, and at least in theory making it fire one event could be better than separate ones.
  • Because the existing behavior has been in place for 10+ years without a major problem to my knowledge. I would hate to address a fringe case by introducing some new and possible more pervasive problem.

@labkey-tchad

Copy link
Copy Markdown
Member Author

@labkey-tchad: this is an interesting patch...can you say more about how this is manifesting?

  • I can see how in theory bubbling the change event might raise odd problems, or report change events that are misleading. At least by eye, the change seems OK, and at least in theory making it fire one event could be better than separate ones.
  • Because the existing behavior has been in place for 10+ years without a major problem to my knowledge. I would hate to address a fringe case by introducing some new and possible more pervasive problem.

In some tests, datetime fields' default values overwrite the test user's input with some other value. There is already at least one workaround in a test but updating Firefox has exacerbated it enough that the workaround isn't cutting it.

@bbimber

bbimber commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

@labkey-tchad, ok, thanks for the background. I cant see the TNPRC repo, but Binal's comment on the EHR repo was helpful. At least conceptually this seems reasonable.

@labkey-tchad
labkey-tchad marked this pull request as ready for review November 16, 2026 23:13
An exception while setting the inner fields no longer leaves change events suspended.
@labkey-tchad
labkey-tchad merged commit cc87382 into release26.11-SNAPSHOT Nov 17, 2026
7 of 8 checks passed
@labkey-tchad
labkey-tchad deleted the 26.11_fb_datetime_field_change_1920 branch November 17, 2026 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants